//
//  ViewController.m
//  UI_homework_06_navigationController
//
//  Created by li cheng on 16/7/21.
//  Copyright © 2016年 li cheng. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    
    
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.086 green:0.655 blue:0.949 alpha:1.000];
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"eat"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStylePlain target:self action:@selector(headView:)];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addAction:)];
    
    UISegmentedControl *segment = [[UISegmentedControl alloc] initWithItems:@[@"消息", @"电话"]];
    self.navigationItem.titleView = segment;
    
    
    
}

#pragma mark - 点击头像发生时间
- (void)headView:(UIBarButtonItem *)barButtonItem{
    NSLog(@"头像");
}
#pragma mark - 点击加号发生的事件
- (void)addAction:(UIBarButtonItem *)barButtonItem{
    NSLog(@"添加");
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

